UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QFAWKJ88gEg38tAqLhEcxvDbaBXpw5HODBRZJz7hQmo='
WHERE
key_id = '5c5eb27c5ce59e7677b39bfbbd231e5680a6e843a7ab134c73cb7153e2ea4339'
AND (
token = 'QFAWKJ88gEg38tAqLhEcxvDbaBXpw5HODBRZJz7hQmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)