UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GujDfCQaTlKnmnESqQX8EwjLJFebGow9SsgGGwrvwXk=' 
WHERE 
  key_id = '91f3097dc2867f9c5fcb6ed6773512f6fe5a65d8a0c76286bfb6904306e167ef' 
  AND (
    token = 'GujDfCQaTlKnmnESqQX8EwjLJFebGow9SsgGGwrvwXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021