UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's6ptlQHnltjZeZV7xYSZMtKabsF4auS0PydXAtIf910=' 
WHERE 
  key_id = '7b4e9b65eac5b4937b53cb0e8d6b865773b011d27fb4d7525a5a33f3ac5c0cb9' 
  AND (
    token = 's6ptlQHnltjZeZV7xYSZMtKabsF4auS0PydXAtIf910=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046