UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nRsAGjRZHwFB4ZdPGFRZOeHsgqH7Hhu3j8C6IKOip8I='
WHERE
key_id = 'bcb99f840467f5723417847e7c497d4a624602c5719ffac5e33c154979dc3264'
AND (
token = 'nRsAGjRZHwFB4ZdPGFRZOeHsgqH7Hhu3j8C6IKOip8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)