UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w8K15ZTMPjrFKK6DKriDzxkqN/vgPF9sGmiXzJABM1g='
WHERE
key_id = 'cbc143610853eb60cda85bd3cc88bcea95859522c13209d0fc151b0c66729497'
AND (
token = 'w8K15ZTMPjrFKK6DKriDzxkqN/vgPF9sGmiXzJABM1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)