UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A54iA/lcqi4OEbh0N66nCilf43MpcSzAZBQ29wB0edY='
WHERE
key_id = '2926f74df56cea4b60d738572c3ec29b8784101275860b45aa8d0315622a62c7'
AND (
token = 'A54iA/lcqi4OEbh0N66nCilf43MpcSzAZBQ29wB0edY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)