UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o62gvfBTH5fr48dvVg7OY9s/WB6qBQ5AdVKTTlZJhxE='
WHERE
key_id = '516b3c6df95045e9e41292ec445ea6cde809e61feddff356f788724bfc8d0cc0'
AND (
token = 'o62gvfBTH5fr48dvVg7OY9s/WB6qBQ5AdVKTTlZJhxE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)