UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mB6S9Y38NqO7kPw8fp4Au5752/5CzUfuzSbcTlcb97E='
WHERE
key_id = '3b548800cb0ac99e76e71e2bfa9649dd81d66374612d93888b21ad99561561af'
AND (
token = 'mB6S9Y38NqO7kPw8fp4Au5752/5CzUfuzSbcTlcb97E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)