UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tD9t+sN7tyKCA5KxGq9wbk4mawLRr3ZsliCSf1Q8lZ8='
WHERE
key_id = '619e2cbe6a2d2f9644fb090056fafa2eb13cc9477560deb75cc29ce6ecaac20d'
AND (
token = 'tD9t+sN7tyKCA5KxGq9wbk4mawLRr3ZsliCSf1Q8lZ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)