UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd7jJw/W4vPHq3Lfy2p6VfrD+MdmVMz6FMEG8ESwqmI8='
WHERE
key_id = '1734a93e0010d341d4f7bd6cc8fd360eeba6f9d5df9f607f1d163e4a60b46bed'
AND (
token = 'd7jJw/W4vPHq3Lfy2p6VfrD+MdmVMz6FMEG8ESwqmI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)