UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '39tbtODEsoWZ+MMhIQh+4U11onrWX7l3l94HLD2ch7c=' 
WHERE 
  key_id = '1dfb92a5bd66324fe6102a760050a7eec6d3dd149b4cf0f01cca84217f5991b6' 
  AND (
    token = '39tbtODEsoWZ+MMhIQh+4U11onrWX7l3l94HLD2ch7c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033