UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jAl1TxWYNlR3cncqs5Y+mXDFo9Amhgxl4Yejzfsuadc='
WHERE
key_id = 'c1aca452f3abb8a9bb475e1cbb14b3e55f0ab89a9e97a245f50ae0ce91c7fd93'
AND (
token = 'jAl1TxWYNlR3cncqs5Y+mXDFo9Amhgxl4Yejzfsuadc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)