UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Py7HDlVpPD0EkwkRpmFCCJPHfGJjq1CWe86ZWQRBQsA='
WHERE
key_id = '3bf7605529bdd2928a621d1804f64127681eae314475ddb85d2e305aab0b8ad7'
AND (
token = 'Py7HDlVpPD0EkwkRpmFCCJPHfGJjq1CWe86ZWQRBQsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)