UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qTzVo0WnXW/fV8TDKfcCKxETOqPyqPohDMDu1/zkMz4='
WHERE
key_id = '4a13703ebd1143ffc93ccf84eaafc6780ce651424dc9cb86774dc071a5a6bd0c'
AND (
token = 'qTzVo0WnXW/fV8TDKfcCKxETOqPyqPohDMDu1/zkMz4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)