UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1nhKA3qCQHIKoEOyBM63g4RhzhNAKJRQk69l3+hTCOI=' 
WHERE 
  key_id = '71961967589a99e1ffb5d00f45c86fcbfd837125e7e2a311b00a5776f5a408fd' 
  AND (
    token = '1nhKA3qCQHIKoEOyBM63g4RhzhNAKJRQk69l3+hTCOI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034