UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SDzAJYqpOqk0WvSRbDCd3l+O/IW2O2plxvQqj3WSKPI=' 
WHERE 
  key_id = 'c23bb45e9d0a9fbd79b1e9a5b1929e5f26f753a6403f7d7dcd7c0bebabbf9715' 
  AND (
    token = 'SDzAJYqpOqk0WvSRbDCd3l+O/IW2O2plxvQqj3WSKPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035