UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+Tz0No5hxmXWStBBZDy2/PLQSns9hqFM35rZLxLZHkQ=' 
WHERE 
  key_id = '549888ccb579b1ba1e9cfd07ab4fbc0e042a782fbe3f49accfa251a1abb7f3fb' 
  AND (
    token = '+Tz0No5hxmXWStBBZDy2/PLQSns9hqFM35rZLxLZHkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040