UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jXZmJyNU+diOMWlhGM9oEJ7iy9UISHGyx3paOj6lF9U=' 
WHERE 
  key_id = 'f208e6c17a576866dee37f35e7f479fb9fe8f9b891445ce2d40da74286c1311f' 
  AND (
    token = 'jXZmJyNU+diOMWlhGM9oEJ7iy9UISHGyx3paOj6lF9U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021