UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GHBAJ/MqxnRWFrKn0MgWdWTcbccLCOzILqIDRQ7BvO8='
WHERE
key_id = 'a6cfc6536d5af06b5c11524bda3eaad444076aec1b7c4006c3a4943587b12f6b'
AND (
token = 'GHBAJ/MqxnRWFrKn0MgWdWTcbccLCOzILqIDRQ7BvO8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)