UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sURdy+y6DxhMk1TTjmhcZyAAHMiXzUQDIJ26hP5ckEw=' 
WHERE 
  key_id = '7d0554d4884777d7191a91f7f5a25d644307fc7ffacddc18ea3859739c7f781c' 
  AND (
    token = 'sURdy+y6DxhMk1TTjmhcZyAAHMiXzUQDIJ26hP5ckEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019