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