UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cfxy+WxcrEXiu6sARqGxyyGVlsRzKj8h9niFkJiHR1Y=' 
WHERE 
  key_id = '97f95ea8d2e4e008d38f24ac942f10f4a8c1ea5e7b0f2d81a4fae24ef3c93a77' 
  AND (
    token = 'cfxy+WxcrEXiu6sARqGxyyGVlsRzKj8h9niFkJiHR1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031