UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FKHkcdaPvtVz2NDJ6kHyyTqS1yDn2zrvsY74Q3QVzg0='
WHERE
key_id = 'a9f4e9571a3905e37cd20656b66503f28d72a7f2e25ec213ac50042f29007acd'
AND (
token = 'FKHkcdaPvtVz2NDJ6kHyyTqS1yDn2zrvsY74Q3QVzg0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)