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