UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3wJg4xxIxdlDTFpTIlJK3/3jojbwBAr4aRJ8aPcxmDs=' 
WHERE 
  key_id = 'ff71f7e5a287a5cc33edcbf7193d6267dda9b3617b40c357b4be196ea51fc74d' 
  AND (
    token = '3wJg4xxIxdlDTFpTIlJK3/3jojbwBAr4aRJ8aPcxmDs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024