UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HzryP2WAXH4mn5TmsRH2/XVtqjePvdN0dFA1XR6Ez2U=' 
WHERE 
  key_id = '6e2da40a92dc8d6f7bb0d3b8edc4ba4a4e80a1e1b3dddf07caedc9e7988ccd8a' 
  AND (
    token = 'HzryP2WAXH4mn5TmsRH2/XVtqjePvdN0dFA1XR6Ez2U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019