UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '883TxOf9C/yWfLx5yletHPdIQnaT6wExZlTOxGe8jek='
WHERE
key_id = '6f6f0eab7cbdc25984443441a8cc568047f229072267876b04f2b79646551509'
AND (
token = '883TxOf9C/yWfLx5yletHPdIQnaT6wExZlTOxGe8jek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)