UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4mlW6NT7qQ4+8EsAepnioboileE3v51iJ0Z4snMdMHs=' 
WHERE 
  key_id = 'aeba0932d7a59e94260332775ad64d4618b28a890bf001eee6c3a0fdbd92a29e' 
  AND (
    token = '4mlW6NT7qQ4+8EsAepnioboileE3v51iJ0Z4snMdMHs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041