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