UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ro+6NfT/vpSYid7KxZBCeI3e4E9JQJ/2luIolmGEL8o='
WHERE
key_id = '328b65b83b5defc33c4931e47683e31661ee92f789aa7025fb90bdc2cc713f59'
AND (
token = 'ro+6NfT/vpSYid7KxZBCeI3e4E9JQJ/2luIolmGEL8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)