UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yut3iz+AJUAEjk2x4IlLDLnslkd2TrVRw0vSlER021c='
WHERE
key_id = 'c2fb8e4eb13eedae6acfc1b862e0e8509a84d06fa64c90738f3b4cd766b069ae'
AND (
token = 'Yut3iz+AJUAEjk2x4IlLDLnslkd2TrVRw0vSlER021c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)