UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pa6R522G2IdZ4gqBan8hAjMtfgAr9PnDFPr5H3iIgFY='
WHERE
key_id = '41d47274cdb320ed1f5706c519c2a5576d58ba1a712ebdea6ca14836d7989ea2'
AND (
token = 'Pa6R522G2IdZ4gqBan8hAjMtfgAr9PnDFPr5H3iIgFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)